<template>
	<button @click="onClick" ref="cntRef">{{ count }}</button>
</template>

<script setup>
import { nextTick, ref } from 'vue';

	const count = ref(0)
	const cntRef = ref(null)

	// const onClick = () => {
	// 	count.value++;
	// 	console.log(cntRef.value.textContent)

	// 	nextTick(() => {
	// 		console.log(cntRef.value.textContent)	
	// 	})
	// }

	const onClick = async () => {
		count.value++;
		console.log(cntRef.value.textContent)

		await nextTick()
		console.log(cntRef.value.textContent)	
	}
	
</script>

<style scoped>

</style>